# 导入对应的数据
import pandas as pd

from django.views import View
# 导入返回响应
from SaaSDevelTool.data_return_response import create_response
# 导入错误信息装饰器
from SaaSDevelTool.data_return_response import error_message_detection
# 导入分页
from SaaSDevelTool.data_mysql_data import db
# 查询当前参数是否是int类型
from SaaSDevelTool.data_operation import is_number

"""
获取列表数据
"""


class SaaSDevelModelListQuery(View):
    @error_message_detection
    def get(self, request):
        # 获取功能包sql语句
        query_sum_model_table_sql = """
            SELECT 
                model_id as id,
                model_name as name 
            FROM 
                db_saas_center.sum_model_table
            ;"""
        # 获取查询出来的值
        query_sum_model_table_data = db.findAll(query_sum_model_table_sql)
        # 返回对应的相应
        return create_response(code=200, msg="", data=query_sum_model_table_data)
